<div class="control-group form-horizontal" style="margin: 0 0 0 0;">
    <div class="row row-hover recommend-element">
        <div class="span4">
            <label class="control-label-small" >关系</label>
            <p class="controls-text-small" ></p>
        </div>
        <div class="span1-compact" style="display: none;padding-top: 5px">
            <span class="add-on remove-input" ><i class="icon-edit"></i></span>
        </div>
    </div>
    <div class="control-sub" style="display:none;">
        <div>
            <label class="control-label-small" >Class1</label>
            <input type="text" class="span2 search-relation input-1" style="margin-left: 10px" data-provide="typeahead" data-items="10" autocomplete="off">
        </div>
        <div>
            <label class="control-label-small" >Class2</label>
            <input type="text" class="span2 search-relation input-2" style="margin-left: 10px" data-provide="typeahead" data-items="10" autocomplete="off">
        </div>
        <div class="btn-group  controls-small">
            <a href="javascript:;" class="btn btn-primary icd-element-input-relation-submit">确定</a>
            <a href="javascript:;" class="btn icd-element-input-relation-cancel">取消</a>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(function(){
        $('.search-relation.input-1').typeahead({
            source:function(query, process){
                var search_relation = getSource(icd['relation'],ccd['relation']);
                var search_relation1 = [];
                var split;
                var json = {};
                for(var i=0;i<search_relation.length;i++){
                    split=search_relation[i].split("-");
                    if(json[split[0]] === undefined){
                        json[split[0]] = 1;
                        search_relation1.push(split[0]);
                    }
                }
                process(search_relation1);
            }
        });

        $('.search-relation.input-2').typeahead({
            source:function(query, process){
                var search_relation = getSource(icd['relation'],ccd['relation']);
                var search_relation2 = [];
                var split;
                var json={};
                for(var i=0;i<search_relation.length;i++){
                    split=search_relation[i].split("-");
                    if(json[split[1]] === undefined){
                        json[split[1]] = 1;
                        search_relation2.push(split[1]);
                    }
                }
                process(search_relation2);
            }
        });

    });
</script>